package com.lbs.demo.controllers;


import com.lbs.demo.services.MusicCrawler.NetEaseCloudMusicCrawler;
import com.lbs.demo.services.MusicCrawler.QQMusicCrawler;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("/music")
public class MusicController {

    @RequestMapping(value = "NetEaseMusicHot", method = RequestMethod.GET)
    public String NetEaseMusicHot(ModelMap map) {
        map.addAttribute("musicList", NetEaseCloudMusicCrawler.getHotMusic());
        return "NetEaseMusicHot";
    }

    @RequestMapping(value = "NetEaseMusicRise", method = RequestMethod.GET)
    public String NetEaseMusicRise(ModelMap map) {
        map.addAttribute("musicList", NetEaseCloudMusicCrawler.getRiseMusic());
        return "NetEaseMusicRise";
    }

    @RequestMapping(value = "NetEaseMusicNew", method = RequestMethod.GET)
    public String NetEaseMusicNew(ModelMap map) {
        map.addAttribute("musicList", NetEaseCloudMusicCrawler.getNewMusic());
        return "NetEaseMusicNew";
    }

    @RequestMapping(value = "QQMusicHot", method = RequestMethod.GET)
    public String QQMusicHot(ModelMap map) {
        map.addAttribute("musicList", QQMusicCrawler.getHotMusic());
        return "QQMusicHot";
    }

    @RequestMapping(value = "QQMusicNew", method = RequestMethod.GET)
    public String QQMusicNew(ModelMap map) {
        map.addAttribute("musicList", QQMusicCrawler.getNewMusic());
        return "QQMusicNew";
    }

    @RequestMapping(value = "QQMusicPopular", method = RequestMethod.GET)
    public String QQMusicPopular(ModelMap map) {
        map.addAttribute("musicList", QQMusicCrawler.getPopularMusic());
        return "QQMusicPopular";
    }
}
